package com.sinochem.yunlian.ship.common.enums;

import lombok.Getter;

/**
 * @Auther: zzd
 * @Dscription:
 * @Date: Create in 2017/11/20 17:08
 **/

public enum UserType {
    RECEIVE(2,"安芯收"),
    SHIPOWNER(1 , "船东"),
    CATEGORY(0 , "货主");

     @Getter
     private int typeCode;
     @Getter
     private String name;

     UserType(int typeCode, String name){
        this.typeCode = typeCode;
        this.name = name;
     }

    public int getTypeCode() {
        return typeCode;
    }

    public String getName() {
        return name;
    }

    public static String getNameByTypeCode(int typeCode) {
        for (UserType userType : UserType.values()) {
            if (userType.getTypeCode() == typeCode) {
                return userType.getName();
            }
        }
        return null;
    }

}
